package com.pomr.service.sys;

import java.util.List;
import java.util.Map;

import com.pomr.model.sys.Agency;
import com.pomr.model.sys.City;
import com.pomr.model.sys.Coutry;
import com.pomr.model.sys.Province;
import com.pomr.model.sys.User;
import com.pomr.util.page.Page;

public interface AgencyService {
	/**
	 * 通过省份ID获取信息
	 * @param provinceId
	 * @return
	 */
	public List<Province> getAllProvince() throws Exception;//获取位置信息
	
	/**
	 * 通过省份获取市信息
	 * @param provinceId
	 * @return
	 * @throws Exception
	 */
	public List<City> getAllCity(String provinceId) throws Exception;//获取市信息
	
	/**
	 * 通过市获取县信息
	 * @param cityId
	 * @return
	 * @throws Exception
	 */
	public List<Coutry> getAllCoutry(String cityId) throws Exception;//获取县信息
	
	/**
	 * 添加机构
	 * @param agency
	 * @return
	 * @throws Exception
	 */
	public boolean insertAgency(Agency agency) throws Exception;
	
	/**
	 * 查询机构
	 * @param agency
	 * @param provinceId
	 * @param cityId
	 * @param coutryId
	 * @return
	 * @throws Exception
	 */
	public Page<Agency> findAgencys(Agency agency, String provinceId, String cityId, String coutryId, String page) throws Exception;
	
	public Page<List<Agency>> findAgencys(Agency agency, String provinceId, String cityId, String coutryId, String page,String rows) throws Exception;
	
	/**
	 * 验证机构编号是否已存在
	 * @param identifier
	 * @return 存在false 
	 * @throws Exception
	 */
	public boolean valiAgency(String identifier) throws Exception;
	
	/**
	 * 获取用户下属机构
	 * @return
	 * @throws Exception
	 */
	public List<Agency> findAgencysOfUser(User user) throws Exception;
	
	/**
	 * 获取机构完整信息
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Agency findAgencyAllInfo(Integer id) throws Exception;
	
	/**
	 * 更新机构信息
	 * @param agency
	 * @return
	 * @throws Exception
	 */
	public boolean updateAgency(Agency agency) throws Exception;
	
	public boolean deleteAgencys(List<String> ids) throws Exception;
	
	/**
	 * 获取用户当前以及下属机构（超级管理员获取所有的机构）
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public List<Agency> searchAgencysOfUser(User user) throws Exception;
	/**
	 * 通过条件查询机构信息 （机构编号、最顶级机构、状态）
	 * @return
	 */
	public Page<List<Agency>> searchAgencysByCond(String identifier, String patientId, String status, String limit, String page) throws Exception;
	
	public boolean changeStatus(Agency agency) throws Exception;

	public List<Agency> searchAllAgencys() throws Exception;

}
